#!/bin/bash

path=`pwd`/logs
if [ ! -d $path ]; then
 mkdir -p $path
fi

SERVER_CONF="config/server.conf"
SERVER=""
if [ -f $SERVER_CONF ]; then
    SERVER=$(cat $SERVER_CONF)
fi

JAR_NAME=$(find . -name "*.jar" -print |head -n 1)

echo -e "java $SERVER -jar $JAR_NAME >/dev/null & echo $! > config/app.pid"

nohup java $SERVER -jar $JAR_NAME >/dev/null & echo $! > config/app.pid
echo -e "Service Startup Successful\n"
